package com.hsmpay.mobile.service.user.impl;

import com.hsmpay.common.service.impl.BaseServiceSupport;
import com.hsmpay.mobile.dao.user.BindingBankCardLogDao;
import com.hsmpay.mobile.pojo.user.BindingBankCardLog;
import com.hsmpay.mobile.service.user.BindingBankCardLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 绑定银行卡日志 服务接口 bindingBankCardLogService
 *
 * @param <Entity>
 * @param <Query>
 * @author 颜铃璋
 *         建立时间：2013-7-1
 */
@Service("bindingBankCardLogService")
public class BindingBankCardLogServiceImpl extends BaseServiceSupport<BindingBankCardLog, Long> implements BindingBankCardLogService<BindingBankCardLog, Long> {
    @Resource(name = "bindingBankCardLogDao")
    BindingBankCardLogDao<BindingBankCardLog, Long> bindingBankCardLogDao;

    /**
     * 根据userId 查询是否有等待认证的 银行卡日志
     *
     * @param userId
     * @return
     * @throws Exception
     */
    public boolean isHaveWaitBankLog(Long userId) throws Exception {
        BindingBankCardLog param = new BindingBankCardLog();
        param.setUserId(userId);
        param.setStatus(2);
        List<BindingBankCardLog> list = bindingBankCardLogDao.searchEntityList(param);
        if (list.size() > 0) {
            return true;
        } else {
            return false;
        }
    }


    //---------------------set get start--------------------
    //---------------------set get end----------------------
}
